package com.itheima.myfactorial;

// 递归调用不死神兔,前两个月不生,第三个月开始生
public class Demo3 {
    public static void main(String[] args) {
        int result = getRubbit(20);
        System.out.println("result = " + result);
    }

    private static int getRubbit(int mouth) {
        if (mouth == 1 || mouth == 2) {
            return 1;
        } else {
            return getRubbit(mouth - 1) + getRubbit(mouth - 2);
        }
    }
}
